import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from './router';
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import qs from 'qs'
Vue.use(ElementUI);
import axios from 'axios';
axios.defaults.baseURL='http://localhost:3010'
Vue.prototype.$http = axios;
Vue.prototype.qs = qs;
import dataV from '@jiaminghi/data-view'

Vue.use(dataV)
Vue.config.productionTip = false
// 请求拦截器
axios.interceptors.request.use(config=>{
  console.log(config,"config")
  NProgress.start()
  config.headers.Authorization = window.sessionStorage.getItem("token");
  return config;
})
// 响应拦截器
//Nprogress
axios.interceptors.response.use(config=>{
  NProgress.done()
  return config;
})
new Vue({
  render: h => h(App),
  router,
}).$mount('#app')
